<link rel="stylesheet" href="assets/store/css/goods.css?v=<?= $version ?>">
<style>
    .table_box{
        min-width: 1000px;
    }

    .table_box .table-title{
        line-height: 30px;
    }

    .table_box th{
        display: block;
        padding:  3px;
    }
    .table_box .table-title th{
        width: 100%;
        text-align: center;
    }
    .table_box .table-fbt{
        width: 100%;
        line-height: 30px;
        text-align: left;
    }
    .table_box td{
        text-align: left;
        padding:0  3px;
        line-height: 40px;
        width: 7.6%;
    }
    .table_box tbody{
        display: table;
        width: 100%;
    }

    .table_box input{
        outline: 0;
        border: 0!important;
        padding-top: 0!important;
        padding-bottom: 0!important;
        line-height: 40px!important;
    }
    .table_box .short-input td span{
        float: left;
    }
    .table_box .short-input td input[type='text']{
        width: 70% !important;
        border: 0 !important;
        float: left;
    }
    .table_box .short-input-radio input{
        width: 20px;
        float: right;
    }
    .am-radio-inline{
        display: flex;
        align-items: center;
        float: left;
        padding-top: 0!important;
    }
    .am-radio-inline .am-ucheck-icons{
        line-height: 20px!important;
    }
</style>
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">基本信息</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-1 am-u-lg-1 am-form-label form-require"> 教练 </label>
                                <div class="am-u-sm-5 am-u-end">
                                    <input type="text" class="tpl-form-input" name="goods[goods_name]"
                                           value="<?= $detail['coach']['real_name'] ?>" disabled>
                                </div>
                            </div>
                            <div class="tablebox">
                                <table class="table_box"  border="1" cellspacing="0" cellpadding="0">
                                   <thead>
                                   <tr class="table-title"><th><input type="text" name="fitness[title]" value="<?= $detail['title'];?>" placeholder="eg:运动能力评估" style="text-align: center"></th></tr>
                                   </thead>
                                    <tbody>
                                        <tr class="short-input">
                                            <td colspan="6"><span>会员：</span><input type="text" name="fitness[user][name]" value="<?= $fitness['user']['name']?>"></td>
                                            <td colspan="6">
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="fitness[user][sex]" value="1" <?= $fitness['user']['sex'] == 1?'checked':''?> data-am-ucheck checked>男
                                                </label>
                                                <label class="am-radio-inline">
                                                    <input type="radio" name="fitness[user][sex]" value="0" <?= $fitness['user']['sex'] != 1?'checked':''?> data-am-ucheck>女
                                                </label>
                                            </td>
                                        </tr>
                                    <tr class="short-input">
                                        <td colspan="2">
                                            <span>联系电话：</span>
                                            <input type="text" name="fitness[user][phone]" value="<?= $fitness['user']['phone']?>" style="width: 60% !important;">
                                        </td>
                                        <td colspan="4">
                                            <span>日期：</span>
                                            <input type="text" class="am-form-field" value="<?= $detail['date']?>" placeholder="评估时间" name="fitness[date]" data-am-datepicker>
                                        </td>
                                        <td>心肺功能</td>
                                        <td colspan="5">
<!--                                            <input type="text" style="width: 100%" name="fitness[user][xinfei]" value="">-->
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">身体结构</td>
                                        <td>肺活量</td>
                                        <td colspan="5"><input type="text" name="fitness[user][feihuoliang]" value="<?= $fitness['user']['feihuoliang']?>" style="width: 100%"></td>
                                    </tr>
                                    <tr class="short-input">
                                        <td>身高:</td>
                                        <td><input type="text" name="fitness[user][height]" value="<?= isset($fitness['user']['height']) ?: '';?>"><span>cm</span></td>
                                        <td>身体质量指数：</td>
                                        <td colspan="3"><input type="text" name="fitness[user][body_number]" value="<?= $fitness['user']['body_number']?>"></td>
                                        <td>摄氧能力</td>
                                        <td colspan="5"><input type="text" name="fitness[user][sheyang]" value="<?= $fitness['user']['sheyang']?>"></td>
                                    </tr>
                                        <tr class="short-input">
                                            <td>体重:</td>
                                            <td><input type="text" name="fitness[user][weight]" value="<?= $fitness['user']['weight']?>"><span>kg</span></td>
                                            <td>体脂百分比：</td>
                                            <td colspan="3"><input type="text" name="fitness[user][fat]" value="<?= $fitness['user']['fat']?>"></td>
                                            <td>恢复能力</td>
                                            <td colspan="5"><input type="text" name="fitness[user][huifu]" value="<?= $fitness['user']['huifu']?>"></td>
                                        </tr>
                                    <tr>
                                        <td>柔韧</td>
                                        <?php foreach ($standard as $v): ?>
                                            <td>
                                                <label class="am-radio-inline">
                                                    <?= $v['name']; ?>
                                                    <input type="radio" name="fitness[user][rou]" <?= $fitness['user']['rou'] == $v['value']?'checked':'' ?> value="<?= $v['value']; ?>" data-am-ucheck>
                                                </label>
                                            </td>
                                        <?php endforeach; ?>
                                        <td>心跳与血压状况</td>
                                        <td colspan="5"><input type="text" style="width: 100%;" name="fitness[user][xueya]" value="<?= $fitness['user']['xueya']?>"></td>
                                    </tr>
                                        <tr>
                                            <td>平衡</td>
                                            <?php foreach ($standard as $v): ?>
                                                <td>
                                                    <label class="am-radio-inline">
                                                        <?= $v['name']; ?>
                                                        <input type="radio" name="fitness[user][balance]" <?= $fitness['user']['balance'] == $v['value']?'checked':'' ?> value="<?= $v['value']; ?>" data-am-ucheck>
                                                    </label>
                                                </td>
                                            <?php endforeach; ?>
                                            <td colspan="6"></td>
                                        </tr>
                                        <tr>
                                            <td>灵敏</td>
                                            <?php foreach ($standard as $v): ?>
                                                <td>
                                                    <label class="am-radio-inline">
                                                        <?= $v['name']; ?>
                                                        <input type="radio" name="fitness[user][lingmin]" <?= $fitness['user']['lingmin'] == $v['value']?'checked':'' ?> value="<?= $v['value']; ?>" data-am-ucheck>
                                                    </label>
                                                </td>
                                            <?php endforeach; ?>
                                            <td>肌肉均衡</td>
<!--                                            <td colspan="5"><input type="text" name="fitness[user][jirou_balance]" value="" style="width: 100%;"></td>-->
                                        </tr>
                                        <tr>
                                            <td>耐力</td>
                                            <?php foreach ($standard as $v): ?>
                                                <td>
                                                    <label class="am-radio-inline">
                                                        <?= $v['name']; ?>
                                                        <input type="radio" name="fitness[user][naili]" <?= $fitness['user']['naili'] == $v['value']?'checked':'' ?> value="<?= $v['value']; ?>" data-am-ucheck>
                                                    </label>
                                                </td>
                                            <?php endforeach; ?>
                                            <td>左上肢</td>
                                            <td colspan="5"><input type="text" name="fitness[user][left_up]" value="<?= $fitness['user']['left_up']?>" style="width: 100%;"></td>
                                        </tr>
                                        <tr>
                                            <td>控制</td>
                                            <?php foreach ($standard as $v): ?>
                                                <td>
                                                    <label class="am-radio-inline">
                                                        <?= $v['name']; ?>
                                                        <input type="radio" name="fitness[user][kongzhi]" <?= $fitness['user']['kongzhi'] == $v['value']?'checked':'' ?> value="<?= $v['value']; ?>" data-am-ucheck>
                                                    </label>
                                                </td>
                                            <?php endforeach; ?>
                                            <td>右上肢</td>
                                            <td colspan="5"><input type="text" name="fitness[user][right_up]" value="<?= $fitness['user']['right_up']?>" style="width: 100%;"></td>
                                        </tr>
                                        <tr>
                                            <td colspan="6">关节灵活性与稳定性测试</td>
                                            <td>躯干</td>
                                            <td colspan="5"><input type="text" name="fitness[user][qugan]" value="<?= $fitness['user']['qugan']?>" style="width: 100%;"></td>
                                        </tr>
                                        <tr>
                                            <td >部位</td>
                                            <td >目的</td>
                                            <td >动作</td>
                                            <td colspan="3">评估情况</td>
                                            <td>左下肢</td>
                                            <td colspan="5"><input type="text" name="fitness[user][left_down]" value="<?= $fitness['user']['left_down']?>" style="width: 100%;"></td>
                                        </tr>
                                        <tr>
                                            <td >髋 膝 踝关节</td>
                                            <td >灵活性稳定性</td>
                                            <td >深蹲</td>
                                            <td colspan="3"><input type="text" name="fitness[testing][shendun]" value="<?= $fitness['testing']['shendun']?>"></td>
                                            <td>右下肢</td>
                                            <td colspan="5"><input type="text" name="fitness[user][right_down]" value="<?= $fitness['user']['right_down']?>" style="width: 100%;"></td>
                                        </tr>
                                        <tr>
                                            <td >髋 膝 踝关节</td>
                                            <td >灵活性稳定性</td>
                                            <td >上踏步</td>
                                            <td colspan="3"><input type="text" name="fitness[testing][shangtabu]" value="<?= $fitness['testing']['shangtabu']?>"></td>
                                            <td colspan="6" rowspan="2">综合评估：</td>
                                        </tr>
                                        <tr>
                                            <td >肩胛 胸推</td>
                                            <td >灵活性</td>
                                            <td >颈后触摸</td>
                                            <td colspan="3"><input type="text" name="fitness[testing][jinghou]" value="<?= $fitness['testing']['jinghou']?>"></td>
                                        </tr>
                                        <tr>
                                            <td >腓肠肌 比目鱼肌</td>
                                            <td >柔韧性</td>
                                            <td >直推主动上抬</td>
                                            <td colspan="3"><input type="text" name="fitness[testing][shangtai]" value="<?= $fitness['testing']['shangtai']?>"></td>
                                            <td colspan="6" rowspan="5">
                                                <textarea id="zonghepinggu" cols="30" rows="10" name="fitness[testing][zonghepinggu]"><?= $fitness['testing']['zonghepinggu']?></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >躯干</td>
                                            <td >稳定性</td>
                                            <td >躯干稳定性俯卧撑</td>
                                            <td colspan="3"><input type="text" name="fitness[testing][fuwucheng]" value="<?= $fitness['testing']['fuwucheng']?>"></td>
                                        </tr>
                                        <tr>
                                            <td >躯干</td>
                                            <td >扭转 旋转稳定性</td>
                                            <td >旋转稳定性模式</td>
                                            <td colspan="3"><input type="text" name="fitness[testing][xuanzhuan]" value="<?= $fitness['testing']['xuanzhuan']?>"></td>
                                        </tr>
                                        <tr>
                                            <td colspan="3">1分：无法完成整个动作或无法保持起始动作</td>
                                            <td colspan="3">2分：完成质量不高</td>
                                        </tr>
                                        <tr>
                                            <td colspan="6">3分：高质量完成</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <!-- 表单提交按钮 -->
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>

                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="assets/common/js/vue.min.js"></script>
<script src="assets/common/js/ddsort.js"></script>
<script src="assets/common/plugins/umeditor/umeditor.config.js?v=<?= $version ?>"></script>
<script src="assets/common/plugins/umeditor/umeditor.min.js"></script>
<script src="assets/store/js/goods.spec.js?v=<?= $version ?>"></script>
<script>

    $(function () {
        function Fitness(){
            this.initialize()
        }
        Fitness.prototype = {
            appVue:null,
            initialize:function () {
                this.appVue = new Vue({
                    el: '#my-form',
                    data: {
                        user:{
                            name:'',sex:'',phone:'',height:'',weight:'',time:'',body_mass:'',fat_per:'',
                            xinfei:'',feihuoliang:'',sheyang:'',huifu:'',heart:'',
                            muscle_balance:'',
                            left_up:'',
                            right_up:'',trunk:'',left_down:'',right_down:'',
                        },
                        sport:{
                            rou:'',
                            balance:'',
                            lingmin:'',
                            naili:'',
                            kongzhi:'',
                        },
                        testing:{
                            deep_squat:'',
                            step:'',
                            touch:'',
                            push:'',
                            push_up:'',
                            stability_mode:'',
                        },

                        evaluation:'',
                    },
                    methods:{
                        getData: function () {
                            return this.$data;
                        }
                    },
                })
            }
        }
        window.Fitness = Fitness
        // 注册商品多规格组件
        var specMany = new Fitness({
            el: '#my-form'
        });
        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm({
            // 获取多规格sku数据
            buildData: function () {
                // var specData = specMany.appVue.getData();
                // return {
                //     goods: {
                //         spec_many: {
                //             spec_attr: specData.spec_attr,
                //             spec_list: specData.spec_list
                //         }
                //     }
                // };
            },
            // 自定义验证
            validation: function () {
                var title = $('input[name="fitness[title]"]').val();
                var date = $('input[name="fitness[date]"]').val();
                var zonghepinggu = $('textarea[name="fitness[testing][zonghepinggu]"]').val();
                if (title === '' || title === undefined) {
                    layer.msg('请输入表头');
                    return false;
                }
                if (date === '' || date === undefined) {
                    layer.msg('请选择评估时间');
                    return false;
                }
                if (zonghepinggu === '' || zonghepinggu === undefined) {
                    layer.msg('请输入综合评估');
                    return false;
                }
                return true;
            }
        });
    });
</script>
